package org.dromara.system.api.feign;

/**
 * @author: zhou shuai
 * @date: 2024/10/5 17:10
 * @version: v1
 */

import org.dromara.common.core.domain.R;
import org.dromara.system.api.domain.vo.RemoteTenantVo;
import org.dromara.system.api.feign.fallback.SystemTenantFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

import static org.dromara.common.core.constant.ServerNameConstants.SYSTEM_SERVER_NAME;

@FeignClient(contextId = "system-tenant-api", name = SYSTEM_SERVER_NAME, fallbackFactory = SystemTenantFallBack.class)
public interface SystemTenantClient {

    /**
     * 根据租户id获取租户详情
     */
    @GetMapping(value = "/api/system/tenant/{tenantId}")
    R<RemoteTenantVo> queryByTenantId(@PathVariable("tenantId") String tenantId);

    /**
     * 获取租户列表
     *
     * @return 结果
     */
    @GetMapping(value = "/api/system/tenant/list")
    R<List<RemoteTenantVo>> queryTenantList();

}
